package cn.com.dcsgo.springcloudstudy.order.service;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author Dcsgo
 * @since 2024-08-06
 */
@Component//                                   指定服务降级的处理类
@FeignClient(value = "cloud-provider-hystrix-payment",fallback = PaymentFallbackService.class)
public interface PaymentHystrixService {
    @GetMapping("/payment/hystrix/ok/{id}")
    String paymentInfoOk(@PathVariable("id") Integer id);

    @GetMapping("/payment/hystrix/timeout/{id}")
    String paymentInfoTimeout(@PathVariable("id") Integer id);

    @GetMapping("/payment/hystrix/running/error/{id}")
    String paymentInfoRunWithError(@PathVariable("id") Integer id);
}
